package com.jianying.domain;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.jianying.shared.Utils;

/**
 * 产品
 * @author
 * 
 */
public class Product {
	
	private Integer id;
	
	private String uuid;
	
	private String productNo;
	
	private String images;
	
	private String unit;
	
	private Integer categoryId;
	
	private String categoryName;
	
	private Double purchasePrice;
	
	private String patternJson;
	
	private Integer tenantId;
	
	private String remark;
	
	private String supplierName;
	
	private Integer supplierId;
	
	private Double salesPrice;
	
	private Integer reviewQuantity;
	
	private Boolean showShop;
	
	private String colorsJson;
	
	private String sizesJson;
	
	private String view360Url;
	
	private List<ProductShare> productShares;
	
	@JsonProperty
	public String firstImage() {
		return Utils.firstImage(images);
	}
	
	@JsonProperty
	public List<String> imageArray() {
		return Utils.imageArray(images);
	}
	
	@SuppressWarnings("unchecked")
	@JsonProperty
	public List<String> colors(){
		return Utils.jsonToBean(getColorsJson(), ArrayList.class);
	}
	
	@SuppressWarnings("unchecked")
	@JsonProperty
	public List<String> sizes(){
		return Utils.jsonToBean(getSizesJson(), ArrayList.class);
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getProductNo() {
		return productNo;
	}

	public void setProductNo(String productNo) {
		this.productNo = productNo;
	}

	public String getImages() {
		return images;
	}

	public void setImages(String images) {
		this.images = images;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Integer getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	public Double getPurchasePrice() {
		return purchasePrice;
	}

	public void setPurchasePrice(Double purchasePrice) {
		this.purchasePrice = purchasePrice;
	}

	public String getPatternJson() {
		return patternJson;
	}

	public void setPatternJson(String patternJson) {
		this.patternJson = patternJson;
	}

	public Integer getTenantId() {
		return tenantId;
	}

	public void setTenantId(Integer tenantId) {
		this.tenantId = tenantId;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getSupplierName() {
		return supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}

	public Integer getSupplierId() {
		return supplierId;
	}

	public void setSupplierId(Integer supplierId) {
		this.supplierId = supplierId;
	}

	public Double getSalesPrice() {
		return salesPrice;
	}

	public void setSalesPrice(Double salesPrice) {
		this.salesPrice = salesPrice;
	}

	public Integer getReviewQuantity() {
		return reviewQuantity;
	}

	public void setReviewQuantity(Integer reviewQuantity) {
		this.reviewQuantity = reviewQuantity;
	}

	public Boolean getShowShop() {
		return showShop;
	}

	public void setShowShop(Boolean showShop) {
		this.showShop = showShop;
	}

	public List<ProductShare> getProductShares() {
		return productShares;
	}

	public void setProductShares(List<ProductShare> productShares) {
		this.productShares = productShares;
	}

	public String getColorsJson() {
		return colorsJson;
	}

	public void setColorsJson(String colorsJson) {
		this.colorsJson = colorsJson;
	}

	public String getSizesJson() {
		return sizesJson;
	}

	public void setSizesJson(String sizesJson) {
		this.sizesJson = sizesJson;
	}

	public String getView360Url() {
		return view360Url;
	}

	public void setView360Url(String view360Url) {
		this.view360Url = view360Url;
	}

	
}
